home *** CD-ROM | disk | FTP | other *** search
/ Apple Reference & Presen…tion Library 2 (Reseller) / Apple R&P Lib Reseller v2.0.iso / 4-Fonts & Software / Demo Software / AppMaker / Demo AppMaker™ / Demo AppMaker™.rsrc / TmpC_203_Window.txt < prev    next >
Encoding:
Text File  |  1989-04-09  |  2.5 KB  |  148 lines

  1. # (decoded with TMPL 13671)
  2. /* %filename% */
  3. /* Created %date% %time% by AppMaker */
  4.  
  5. %If MPW%
  6. #include <Types.h>
  7. #include <Quickdraw.h>
  8. #include <Controls.h>
  9. #include <Dialogs.h>
  10. #include <Events.h>
  11. #include <Lists.h>
  12. #include <Menus.h>
  13. #include <TextEdit.h>
  14.  
  15. %end if%
  16. #include "Globals.h"
  17. #include "ResourceDefs.h"
  18. #include "Scrolling.h"
  19. #include "WindowAids.h"
  20. #include "Miscellany.h"
  21.  
  22. #include "%unitname%.h"
  23.  
  24. %If MPW%
  25. #include <ToolUtils.h>
  26.  
  27. %end if%
  28. #define nil            0L
  29. %If MPW%
  30.  
  31. #pragma segment %unitname%
  32. %end if% 
  33.  
  34. /*----------*/
  35. void Open%WindName% (fName, vRefNum, fRefNum)
  36. Str255        fName;
  37. short        vRefNum;
  38. short        fRefNum;
  39. {
  40.     WindowPtr        newWindow;
  41.     Rect            bounds;
  42.  
  43. %if MPW%
  44. #pragma unused (bounds) 
  45.   
  46. %end if%
  47.     newWindow = GetNewWindow (%WindName%ID, nil, (WindowPtr) -1L);
  48.     SetWTitle (newWindow, fName);
  49.     SetPort (newWindow);
  50.     SetNewInfo (newWindow);
  51.     %MakeItems%
  52.     cur->fileNum    = fRefNum;
  53.     cur->volNum        = vRefNum;
  54.     cur->dirty        = false;
  55.     cur->filename    = NewString (fName);
  56.     cur->windowKind = W%WindName%;
  57.     ShowWindow (newWindow);
  58. } /*Open%WindName%*/
  59.  
  60. /*----------*/
  61. void Close%WindName% ()
  62. {
  63.     %DisposeItems%
  64.     DisposHandle ((Handle) cur->filename);
  65.     DiscardInfo (curWindow);
  66. } /*Close%WindName%*/
  67.  
  68. /*----------*/
  69. void MouseIn%WindName% (where, modifiers)
  70. Point        where;
  71. short        modifiers;
  72. {
  73.     Rect            bounds;
  74.  
  75. %if MPW%
  76. #pragma unused (where, modifiers, bounds) 
  77.   
  78. %end if%
  79.     %MouseInItems%
  80. } /*MouseIn%WindName%*/
  81.  
  82. /*----------*/
  83. void TypeIn%WindName%   (ch)
  84. char        ch;
  85. {
  86.     if (cur->text == nil) {
  87.         SysBeep (1);
  88.     } else {
  89.         TEKey (ch, cur->text);
  90.     }
  91. } /*TypeIn%WindName%*/
  92.  
  93. /*----------*/
  94. void Update%WindName% ()
  95. {
  96.     Rect            bounds;
  97.  
  98. %if MPW%
  99. #pragma unused (bounds) 
  100.   
  101. %end if%
  102.     %UpdateItems%
  103. } /*Update%WindName%*/
  104.  
  105. /*----------*/
  106. void Activate%WindName% (activate)
  107. Boolean        activate;
  108. {
  109. %if MPW%
  110. #pragma unused (activate) 
  111.   
  112. %end if%
  113.     %ActivateItems%
  114. } /*Activate%WindName%*/
  115.  
  116. /*----------*/
  117. void Resize%WindName% ()
  118. {
  119.     /* application-specific code to resize items in window */
  120. } /*Resize%WindName%*/
  121.  
  122. /*----------*/
  123. pascal void Scroll%WindName% (newValue, oldValue)
  124. short        newValue;
  125. short        oldValue;
  126. {
  127. %if MPW%
  128. #pragma unused (newValue, oldValue) 
  129.   
  130. %end if%
  131.     /* application-specific code to scroll window */
  132. } /*Scroll%WindName%*/
  133.  
  134. /*----------*/
  135. void Control%WindName%    (whichControl, whichPart, where)
  136. ControlHandle    whichControl;
  137. short             whichPart;
  138. Point            where;
  139. {
  140.     Rect            bounds;
  141.  
  142. %if MPW%
  143. #pragma unused (whichControl, whichPart, where, bounds) 
  144.   
  145. %end if%
  146.     %ControlItems%
  147. } /*Control%WindName%*/
  148.